﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace GameName1
{
    class PowerUpDeath : PowerUp
    {

        public PowerUpDeath(Vector2 position) : base(position)
        {
        }

        public static void LoadContent(ContentManager contentManager)
        {
            _commonSprite = contentManager.Load<Texture2D>("sprites/death4_v2");
        }

        private static Texture2D _commonSprite;
        protected override Texture2D Sprite
        {
            get { return _commonSprite; }
        }

        public override void HandleHit(IHittable other, GameTime colissionTime)
        {
            if (other is SpaceShip || other is Projectile)
            {
                var spaceShip = GameObjectsManager.GetInstance().GetAllObjectsOfType<SpaceShip>().ElementAt(0);
                spaceShip.HandleHit(this,colissionTime);
            }
            GameObjectsManager.GetInstance().Destroy(this);
        }
    }
}
